// strategydatail.js
var WxParse = require('../../../common/wxParse/wxParse.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    id:'',
    content:'',
    title:''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.showLoading({
      title: '加载中',
    })
    var that=this;
    console.log("--接受：" + options.id);
    wx.request({
      url: 'https://www.wjp147.cn/e2face/strategy/apidetail?id=' + options.id,
      method: "get",
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        wx.hideLoading();
        if (res.data.resultCode == 111) {
          WxParse.wxParse('article', 'html', res.data.content, that, 5);
          that.setData({
            content: res.data.content,
            title: res.data.title
          })
        }
      }, error: function () {
        wx.navigateTo({ url: '../index/index' })
      }
    })
    this.setData({
      id: options.id
    })
  },
})